package com.itheima.d7_interface_demo.practice;

import java.util.ArrayList;

/**
 * 模拟管理系统
 */
public class ClassManager {
    //数据
    //学生的数据
    private ArrayList<Student> students = new ArrayList<>();

    //打印方案
    //面向接口编程的一种体现
    private StudentService studentService = new StudentServiceImpl2();

    public ClassManager() {
        students.add(new Student("迪丽热巴",'女',99));
        students.add(new Student("古力娜扎",'女',100));
        students.add(new Student("马尔扎哈",'男',80));
        students.add(new Student("卡尔巴扎",'男',60));
    }
    //功能
    public void printInfo() {
        //打印班级学生信息
        studentService.printAllInfo(students);
    }

    public void printScore() {
        //求平均分
        studentService.printAverageScore(students);
    }
}
